<?php TPL::output('global/header.tpl.htm'); ?>
<?php TPL::output('account/setting/setting_header.tpl.htm'); ?>

<div class="aw-mod mod-setting-privacy">
	<div class="mod-body">
		<form id="setting_form" method="post" action="account/ajax/privacy_setting/">
			<!--<div class="aw-mod">
				<div class="mod-head">
					<h3><?php _e('微博设置'); ?></h3>
				</div>
				<div class="mod-body">
					<dl>
						<dt><?php _e('是否允许别人访问我的微博'); ?> : </dt>
						<dd>
							<label><input type="radio" value="1" name="weibo_visit"<?php if ($this->user_info['weibo_visit'] == 1) { ?> checked="checked"<?php } ?> /> <?php _e('是'); ?></label>
							<label><input type="radio" value="0" name="weibo_visit"<?php if (!$this->user_info['weibo_visit']) { ?> checked="checked"<?php } ?> /> <?php _e('否'); ?></label>
						</dd>
					</dl>
				</div>-->
			</div>
			
			<div class="aw-mod">
				<div class="mod-head">
					<h3><?php _e('私信设置'); ?></h3>
				</div>
				<div class="mod-body">
					<dl>
						<dt><?php _e('谁可以给我发私信'); ?> :</dt>
						<dd>
							<label><input type="radio"value="0" name="inbox_recv"<?php if (!$this->user_info['inbox_recv']) { ?> checked="checked"<?php } ?> /> <?php _e('所有人'); ?></label>
							<label><input type="radio"value="1" name="inbox_recv"<?php if ($this->user_info['inbox_recv'] == 1) { ?> checked="checked"<?php } ?> /> <?php _e('我关注的人'); ?></label>
						</dd>
					</dl>
				</div>
			</div>
			
			<div class="aw-mod">
				<div class="mod-head">
					<h3><?php _e('邮件设置'); ?></h3>
				</div>
				<div class="mod-body">
					<dl>
						<dt><?php _e('什么情况下给我发邮件'); ?> :</dt>
						<dd>
							<span>
								<label>
									<input name="email_settings[]" value="FOLLOW_ME" type="checkbox"<?php if ($this->user_info['email_settings']['FOLLOW_ME'] != 'N') { ?> checked="checked"<?php } ?> /> <?php _e('当有人关注我'); ?>
								</label>
							</span>
							<span>
								<label>
									<input name="email_settings[]" value="QUESTION_INVITE" type="checkbox"<?php if ($this->user_info['email_settings']['QUESTION_INVITE'] != 'N') { ?> checked="checked"<?php } ?> /> <?php _e('有人邀请我回答问题'); ?>
								</label>
							</span>
							<span>
								<label>
									<input name="email_settings[]" value="NEW_ANSWER" type="checkbox"<?php if ($this->user_info['email_settings']['NEW_ANSWER'] != 'N') { ?> checked="checked"<?php } ?> /> <?php _e('我关注的问题有了新回复'); ?>
								</label>
							</span>
							<span>
								<label>
									<input name="email_settings[]" value="NEW_MESSAGE" type="checkbox"<?php if ($this->user_info['email_settings']['NEW_MESSAGE'] != 'N') { ?> checked="checked"<?php } ?> /> <?php _e('有人向我发送私信'); ?>
								</label>
							</span>
							<span>
								<label>
									<input name="email_settings[]" value="QUESTION_MOD" type="checkbox"<?php if ($this->user_info['email_settings']['QUESTION_MOD'] != 'N') { ?> checked="checked"<?php } ?> /> <?php _e('我的问题被编辑'); ?>
								</label>
							</span>
						</dd>
					</dl>
				</div>
			</div>
			
			<?php if (get_setting('weixin_app_id')) { ?>
			<div class="aw-mod">
				<div class="mod-head">
					<h3><?php _e('微信设置'); ?></h3>
				</div>
				<div class="mod-body">
					<dl>
						<dt><?php _e('什么情况下给我发通知'); ?> :</dt>
						<dd>
							<span>
								<label>
									<input name="weixin_settings[]" value="AT_ME" type="checkbox"<?php if ($this->user_info['weixin_settings']['AT_ME'] != 'N') { ?> checked="checked"<?php } ?> /> <?php _e('当有人 @ 我'); ?>
								</label>
							</span>
							<span>
								<label>
									<input name="weixin_settings[]" value="NEW_ANSWER" type="checkbox"<?php if ($this->user_info['weixin_settings']['NEW_ANSWER'] != 'N') { ?> checked="checked"<?php } ?> /> <?php _e('我的问题有了新回复'); ?>
								</label>
							</span>
							<span>
								<label>
									<input name="weixin_settings[]" value="NEW_ARTICLE_ANSWER" type="checkbox"<?php if ($this->user_info['weixin_settings']['NEW_ARTICLE_ANSWER'] != 'N') { ?> checked="checked"<?php } ?> /> <?php _e('我的文章有了新评论'); ?>
								</label>
							</span>
							<span>
								<label>
									<input name="weixin_settings[]" value="NEW_COMMENT" type="checkbox"<?php if ($this->user_info['weixin_settings']['NEW_COMMENT'] != 'N') { ?> checked="checked"<?php } ?> /> <?php _e('我的回复有了新评论'); ?>
								</label>
							</span>
							<span>
								<label>
									<input name="weixin_settings[]" value="QUESTION_INVITE" type="checkbox"<?php if ($this->user_info['weixin_settings']['QUESTION_INVITE'] != 'N') { ?> checked="checked"<?php } ?> /> <?php _e('有人邀请我回答问题'); ?>
								</label>
							</span>
						</dd>
					</dl>
				</div>
			</div>
			<?php } ?>

			<div class="aw-mod">
				<div class="mod-head">
					<h3><?php _e('通知设置'); ?></h3>
				</div>
				<div class="mod-body">
					<dl>
						<dt><?php _e('什么情况下给我发送通知'); ?> :</dt>
						<dd>
							<?php foreach($this->notify_actions as $key => $val) { ?>
		                    <?php if ($val['user_setting']) { ?>
		                    <span>
		                    	<label>
		                    		<input name="notification_settings[<?php echo $key;?>]" type="checkbox" value="1"<?php if (!in_array($key, $this->notification_settings['data']) OR !$this->notification_settings['data']) { ?> checked="checked"<?php } ?> /> <?php _e($val['desc']); ?>
		                    		</label>
		                    </span>
		                    <?php } ?>
		                	<?php } ?>
						</dd>
					</dl>
				</div>
			</div>
		</form>
	</div>
	<div class="mod-footer clearfix">
		<a href="javascript:;" class="btn btn-large btn-success pull-right" onclick="AWS.ajax_post($('#setting_form'));"><?php _e('保存'); ?></a>
	</div>
</div>

<?php TPL::output('account/setting/setting_footer.tpl.htm'); ?>
<?php TPL::output('global/footer.tpl.htm'); ?>